package com.example.phonetoregion;

import com.example.togetherutils.ReturnInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * Spring Boot通过手机号获取归属地
 */
@RestController
public class PhoneToRegionController {
    @GetMapping("/getPhoneInfo/{phone}")
    public ReturnInfo<?> getPhoneInfo(@PathVariable("phone") String phone) {
        return ReturnInfo.success(PhoneInfoUtil.getPhoneInfo(phone));
    }
}
